/*工资确认item*/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:frametrim/activity/salaryDetailPage.dart';
import 'package:frametrim/app/app_navigator.dart';
import 'package:frametrim/listeners/OnViewClickListener.dart';
import 'package:frametrim/utility/sq_color.dart';

 class SalaryView extends StatelessWidget {
  late String id;
  late String projectName;
  late String groupName;
  late String stateName;
  late String buttonName;

  // final OnViewClickListener? listener;
  // VoidCallback onPress;

  SalaryView(this.projectName, this.groupName, this.stateName, this.buttonName,this.id);


  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        print('跳转详情页');
        AppNavigator.pushToSalaryDetails(context,id);
        // AppNavigator.pushWithName(context, SalaryDetailsPage(''), 'SalarySure');
      },
      child: Container(
        margin: EdgeInsets.fromLTRB(10, 0, 10, 10),
        padding: EdgeInsets.all(10),
        decoration: ShapeDecoration(
            color: Colors.white,
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(5)))),
        child: Column(
          children: <Widget>[
            Row(
              children: <Widget>[
                Expanded(
                    child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Text(
                      projectName,
                      style:
                          TextStyle(fontSize: 20, color: SQColor.color_222222),
                    ),
                    SizedBox(
                      height: 3,
                    ),
                    Text(
                      groupName,
                      style:
                          TextStyle(fontSize: 16, color: SQColor.color_666666),
                    ),
                  ],
                )),
                Text(
                  stateName,
                  style: TextStyle(fontSize: 15, color: SQColor.primary),
                ),
                // SizedBox(width: 10,)
              ],
            ),
            SizedBox(
              height: 10,
            ),
            buildButton()
          ],
        ),
      ),
    );
  }

  /*按钮*/
  Widget buildButton() {
    return Container(
      height: 40,
      decoration: ShapeDecoration(
          color: SQColor.color_DEE5FF,
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.all(Radius.circular(5)))),
      child: Center(
        child: Text(
          buttonName,
          style: TextStyle(fontSize: 14, color: SQColor.primary),
        ),
      ),
    );
  }

}
